package com.gong.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * @ClassName: CharacterEncodingFilter
 * @Description: TODO
 * @Author: 。。。
 * @Data: 2021/10/208:30
 * @Version: 1.0
 **/
public class CharacterEncodingFilter implements Filter {
	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		return;
	}

	@Override
	public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException {
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		resp.setContentType("text/html");

	}

	@Override
	public void destroy() {
		return;
	}
}
